package com.ds.infrastructure.hyperspace.console.model.request.deploy.deploydata;

import com.ds.infrastructure.hyperspace.console.dto.deploydata.VipDTO;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

/**
 * @author: yaozhendong
 * @create: 2019-10-21 10:48
 **/
@Data
@NoArgsConstructor
public class VipForm {
    @NotBlank
    private String id;
    @NotBlank
    private String name;

    public static VipDTO toDTO(VipForm item) {
        VipDTO vipDTO = new VipDTO();
        vipDTO.setId(item.getId());
        vipDTO.setName(item.getName());
        return vipDTO;
    }

    public static VipForm toVO(VipDTO dto) {
        VipForm vipForm = new VipForm();
        vipForm.setId(dto.getId());
        vipForm.setName(dto.getName());
        return vipForm;
    }
}
